<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Jumper documentation</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Jumper</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Finders">Finders</a></li>
<li><a href="#Modes">Modes</a></li>
<li><a href="#Class_Pathfinder_">Class Pathfinder </a></li>
</ul>


<h2>Modules</h2>
<ul>
  <li><a href="../modules/core.bheap.html">core.bheap</a></li>
  <li><a href="../modules/core.heuristics.html">core.heuristics</a></li>
  <li><a href="../modules/core.node.html">core.node</a></li>
  <li><a href="../modules/core.path.html">core.path</a></li>
  <li><a href="../modules/grid.html">grid</a></li>
  <li><strong>pathfinder</strong></li>
</ul>
<h2>Examples</h2>
<ul>
  <li><a href="../examples/annotatedpathing.lua.html">annotatedpathing.lua</a></li>
  <li><a href="../examples/customheuristics.lua.html">customheuristics.lua</a></li>
  <li><a href="../examples/makeclearance.lua.html">makeclearance.lua</a></li>
  <li><a href="../examples/simpleexample.lua.html">simpleexample.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>pathfinder</code></h1>

<p>The Pathfinder class</p>
<p>

</p>

<h2><a href="#Finders">Finders</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Finders">Finders</a></td>
	<td class="summary">Finders (search algorithms implemented).</td>
	</tr>
</table>
<h2><a href="#Modes">Modes</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Modes">Modes</a></td>
	<td class="summary">Search modes.</td>
	</tr>
</table>
<h2><a href="#Class_Pathfinder_">Class Pathfinder </a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:new">Pathfinder:new&nbsp;(grid [, finderName [, walkable]])</a></td>
	<td class="summary">Inits a new <a href="../modules/pathfinder.html#">pathfinder</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:annotateGrid">Pathfinder:annotateGrid&nbsp;()</a></td>
	<td class="summary">Evaluates <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>
 for the whole <a href="../modules/grid.html#">grid</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:clearAnnotations">Pathfinder:clearAnnotations&nbsp;()</a></td>
	<td class="summary">Removes <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>values.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setGrid">Pathfinder:setGrid&nbsp;(grid)</a></td>
	<td class="summary">Sets the <a href="../modules/grid.html#">grid</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getGrid">Pathfinder:getGrid&nbsp;()</a></td>
	<td class="summary">Returns the <a href="../modules/grid.html#">grid</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setWalkable">Pathfinder:setWalkable&nbsp;(walkable)</a></td>
	<td class="summary">Sets the <strong>walkable</strong> value or function.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getWalkable">Pathfinder:getWalkable&nbsp;()</a></td>
	<td class="summary">Gets the <strong>walkable</strong> value or function.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setFinder">Pathfinder:setFinder&nbsp;(finderName)</a></td>
	<td class="summary">Defines the <code>finder</code>.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getFinder">Pathfinder:getFinder&nbsp;()</a></td>
	<td class="summary">Returns the name of the <code>finder</code> being used.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getFinders">Pathfinder:getFinders&nbsp;()</a></td>
	<td class="summary">Returns the list of all available finders names.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setHeuristic">Pathfinder:setHeuristic&nbsp;(heuristic)</a></td>
	<td class="summary">Sets a heuristic.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getHeuristic">Pathfinder:getHeuristic&nbsp;()</a></td>
	<td class="summary">Returns the <code>heuristic</code> used.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getHeuristics">Pathfinder:getHeuristics&nbsp;()</a></td>
	<td class="summary">Gets the list of all available <code>heuristics</code>.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setMode">Pathfinder:setMode&nbsp;(mode)</a></td>
	<td class="summary">Defines the search <code>mode</code>.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getMode">Pathfinder:getMode&nbsp;()</a></td>
	<td class="summary">Returns the search mode.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getModes">Pathfinder:getModes&nbsp;()</a></td>
	<td class="summary">Gets the list of all available search modes.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:setTunnelling">Pathfinder:setTunnelling&nbsp;(bool)</a></td>
	<td class="summary">Enables tunnelling.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getTunnelling">Pathfinder:getTunnelling&nbsp;()</a></td>
	<td class="summary">Returns tunnelling feature state.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:getPath">Pathfinder:getPath&nbsp;(startX, startY, endX, endY, clearance)</a></td>
	<td class="summary">Calculates a <code>path</code>.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Pathfinder:reset">Pathfinder:reset&nbsp;()</a></td>
	<td class="summary">Resets the <a href="../modules/pathfinder.html#">pathfinder</a> .</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Finders"></a>Finders</h2>

    <dl class="function">
    <dt>
    <a name = "Finders"></a>
    <strong>Finders</strong>
    </dt>
    <dd>
    Finders (search algorithms implemented).  Refers to the search algorithms actually implemented in Jumper.</p>

<p> <li><a href="http://en.wikipedia.org/wiki/A*_search_algorithm">A*</a></li>
 <li><a href="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm">Dijkstra</a></li>
 <li><a href="http://aigamedev.com/open/tutorials/theta-star-any-angle-paths/">Theta Astar</a></li>
 <li><a href="http://en.wikipedia.org/wiki/Breadth-first_search">BFS</a></li>
 <li><a href="http://en.wikipedia.org/wiki/Depth-first_search">DFS</a></li>
 <li><a href="http://harablog.wordpress.com/2011/09/07/jump-point-search/">JPS</a></li>





    <h3>see also:</h3>
    <ul>
         <a href="../modules/pathfinder.html#Pathfinder:getFinders">Pathfinder:getFinders</a>
    </ul>
</dd>
</dl>
    <h2><a name="Modes"></a>Modes</h2>

    <dl class="function">
    <dt>
    <a name = "Modes"></a>
    <strong>Modes</strong>
    </dt>
    <dd>
    Search modes.  Refers to the search modes. In ORTHOGONAL mode, 4-directions are only possible when moving,
 including North, East, West, South. In DIAGONAL mode, 8-directions are possible when moving,
 including North, East, West, South and adjacent directions.</p>

<p> <li>ORTHOGNAL</li>
 <li>DIAGONAL</li>





    <h3>see also:</h3>
    <ul>
         <a href="../modules/pathfinder.html#Pathfinder:getModes">Pathfinder:getModes</a>
    </ul>
</dd>
</dl>
    <h2><a name="Class_Pathfinder_"></a>Class Pathfinder </h2>
    The <a href="../modules/pathfinder.html#Class_Pathfinder">Pathfinder</a>  class.<br/>
 This class is callable.
 Therefore,_ <code>Pathfinder(...)</code> <em>acts as a shortcut to</em> <code>Pathfinder:new(...)</code>.
    <dl class="function">
    <dt>
    <a name = "Pathfinder:new"></a>
    <strong>Pathfinder:new&nbsp;(grid [, finderName [, walkable]])</strong>
    </dt>
    <dd>
    Inits a new <a href="../modules/pathfinder.html#">pathfinder</a>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">grid</span>
        <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
       a <a href="../modules/grid.html#">grid</a> </li>
      <li><span class="parameter">finderName</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
       the name of the <code>Finder</code> (search algorithm) to be used for search.
 Defaults to <code>ASTAR</code> when not given (see <a href="../modules/pathfinder.html#Pathfinder:getFinders">Pathfinder:getFinders</a>).</li>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for <strong>walkable</strong> nodes.
 If this parameter is a function, it should be prototyped as <strong>f(value)</strong>, returning a boolean:
 <strong>true</strong> when value matches a <strong>walkable</strong> <code>node</code>, <strong>false</strong> otherwise.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 -- Example one
 local finder = Pathfinder:new(myGrid, 'ASTAR', 0)

 -- Example two
 local function walkable(value)
   return value > 0
 end
 local finder = Pathfinder(myGrid, 'JPS', walkable)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        a new <a href="../modules/pathfinder.html#">pathfinder</a>  instance
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:annotateGrid"></a>
    <strong>Pathfinder:annotateGrid&nbsp;()</strong>
    </dt>
    <dd>
    Evaluates <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>
 for the whole <a href="../modules/grid.html#">grid</a> .  It should be called only once, unless the collision map or the
 <strong>walkable</strong> attribute changes. The clearance values are calculated and cached within the grid nodes.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:annotateGrid()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:clearAnnotations"></a>
    <strong>Pathfinder:clearAnnotations&nbsp;()</strong>
    </dt>
    <dd>
    Removes <a href="http://aigamedev.com/open/tutorial/clearance-based-pathfinding/#TheTrueClearanceMetric">clearance</a>values.
 Clears cached clearance values for the current <strong>walkable</strong>.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:clearAnnotations()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:setGrid"></a>
    <strong>Pathfinder:setGrid&nbsp;(grid)</strong>
    </dt>
    <dd>
    Sets the <a href="../modules/grid.html#">grid</a> .  Defines the given <a href="../modules/grid.html#">grid</a>  as the one on which the <a href="../modules/pathfinder.html#">pathfinder</a>  will perform the search.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">grid</span>
        <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
       a <a href="../modules/grid.html#">grid</a> </li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:setGrid(myGrid)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:getGrid"></a>
    <strong>Pathfinder:getGrid&nbsp;()</strong>
    </dt>
    <dd>
    Returns the <a href="../modules/grid.html#">grid</a> .  This is a reference to the actual <a href="../modules/grid.html#">grid</a>  used by the <a href="../modules/pathfinder.html#">pathfinder</a> .


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local myGrid = myFinder:getGrid()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        the <a href="../modules/grid.html#">grid</a>
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:setWalkable"></a>
    <strong>Pathfinder:setWalkable&nbsp;(walkable)</strong>
    </dt>
    <dd>
    Sets the <strong>walkable</strong> value or function.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for walkable nodes.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 -- Value '0' is walkable
 myFinder:setWalkable(0)

 -- Any value greater than 0 is walkable
 myFinder:setWalkable(function(n)
   return n>0
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:getWalkable"></a>
    <strong>Pathfinder:getWalkable&nbsp;()</strong>
    </dt>
    <dd>
    Gets the <strong>walkable</strong> value or function.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local walkable = myFinder:getWalkable()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
        the <code>walkable</code> value or function
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:setFinder"></a>
    <strong>Pathfinder:setFinder&nbsp;(finderName)</strong>
    </dt>
    <dd>
    Defines the <code>finder</code>.  It refers to the search algorithm used by the <a href="../modules/pathfinder.html#">pathfinder</a> .
 Default finder is <code>ASTAR</code>. Use <a href="../modules/pathfinder.html#Pathfinder:getFinders">Pathfinder:getFinders</a> to get the list of available finders.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">finderName</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
       the name of the <code>finder</code> to be used for further searches.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 --To use Breadth-First-Search
 myFinder:setFinder('BFS')</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/pathfinder.html#Pathfinder:getFinders">Pathfinder:getFinders</a>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:getFinder"></a>
    <strong>Pathfinder:getFinder&nbsp;()</strong>
    </dt>
    <dd>
    Returns the name of the <code>finder</code> being used.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local finderName = myFinder:getFinder()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        the name of the <code>finder</code> to be used for further searches.
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:getFinders"></a>
    <strong>Pathfinder:getFinders&nbsp;()</strong>
    </dt>
    <dd>
    Returns the list of all available finders names.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local finders = myFinder:getFinders()
 for i, finderName in ipairs(finders) do
   print(i, finderName)
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">{string,...}</span></span>
        array of built-in finders names.
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:setHeuristic"></a>
    <strong>Pathfinder:setHeuristic&nbsp;(heuristic)</strong>
    </dt>
    <dd>
    Sets a heuristic.  This is a function internally used by the <a href="../modules/pathfinder.html#">pathfinder</a>  to find the optimal path during a search.
 Use <a href="../modules/pathfinder.html#Pathfinder:getHeuristics">Pathfinder:getHeuristics</a> to get the list of all available <code>heuristics</code>. One can also define
 his own <code>heuristic</code> function.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">heuristic</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
       <code>heuristic</code> function, prototyped as <strong>f(dx,dy)</strong> or as a <a href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a> .</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:setHeuristic('MANHATTAN')</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


    <h3>see also:</h3>
    <ul>
         <li><a href="../modules/pathfinder.html#Pathfinder:getHeuristics">Pathfinder:getHeuristics</a></li>
         <li><a href="../modules/core.heuristics.html#">core.heuristics</a></li>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:getHeuristic"></a>
    <strong>Pathfinder:getHeuristic&nbsp;()</strong>
    </dt>
    <dd>
    Returns the <code>heuristic</code> used.  Returns the function itself.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local h = myFinder:getHeuristic()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
        the <code>heuristic</code> function being used by the <a href="../modules/pathfinder.html#">pathfinder</a>
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.heuristics.html#">core.heuristics</a>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:getHeuristics"></a>
    <strong>Pathfinder:getHeuristics&nbsp;()</strong>
    </dt>
    <dd>
    Gets the list of all available <code>heuristics</code>.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local heur = myFinder:getHeuristic()
 for i, heuristicName in ipairs(heur) do
   ...
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">{string,...}</span></span>
        array of heuristic names.
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/core.heuristics.html#">core.heuristics</a>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:setMode"></a>
    <strong>Pathfinder:setMode&nbsp;(mode)</strong>
    </dt>
    <dd>
    Defines the search <code>mode</code>.
 The default search mode is the <code>DIAGONAL</code> mode, which implies 8-possible directions when moving (north, south, east, west and diagonals).
 In <code>ORTHOGONAL</code> mode, only 4-directions are allowed (north, south, east and west).
 Use <a href="../modules/pathfinder.html#Pathfinder:getModes">Pathfinder:getModes</a> to get the list of all available search modes.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">mode</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
       the new search <code>mode</code>.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:setMode('ORTHOGNAL')</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


    <h3>see also:</h3>
    <ul>
         <li><a href="../modules/pathfinder.html#Pathfinder:getModes">Pathfinder:getModes</a></li>
         <li><a href="../modules/pathfinder.html#Modes">Modes</a></li>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:getMode"></a>
    <strong>Pathfinder:getMode&nbsp;()</strong>
    </dt>
    <dd>
    Returns the search mode.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local mode = myFinder:getMode()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        the current search mode
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/pathfinder.html#Modes">Modes</a>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:getModes"></a>
    <strong>Pathfinder:getModes&nbsp;()</strong>
    </dt>
    <dd>
    Gets the list of all available search modes.


    <h3>Usage:</h3>
    <ul>
        <pre class="example"> local modes = myFinder:getModes()
 for modeName in ipairs(modes) do
   ...
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">{string,...}</span></span>
        array of search modes.
    </ol>


    <h3>see also:</h3>
    <ul>
         <a href="../modules/pathfinder.html#Modes">Modes</a>
    </ul>
</dd>
    <dt>
    <a name = "Pathfinder:setTunnelling"></a>
    <strong>Pathfinder:setTunnelling&nbsp;(bool)</strong>
    </dt>
    <dd>
    Enables tunnelling.  Defines the ability for the <a href="../modules/pathfinder.html#">pathfinder</a>  to tunnel through walls when heading diagonally.
 This feature <strong>is not compatible</strong> with Jump Point Search algorithm (i.e. enabling it will not affect Jump Point Search)

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">bool</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
       a boolean</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">myFinder:setTunnelling(true)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:getTunnelling"></a>
    <strong>Pathfinder:getTunnelling&nbsp;()</strong>
    </dt>
    <dd>
    Returns tunnelling feature state.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local isTunnellingEnabled = myFinder:getTunnelling()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
        tunnelling feature actual state
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:getPath"></a>
    <strong>Pathfinder:getPath&nbsp;(startX, startY, endX, endY, clearance)</strong>
    </dt>
    <dd>
    Calculates a <code>path</code>.  Returns the <code>path</code> from location <strong>[startX, startY]</strong> to location <strong>[endX, endY]</strong>.
 Both locations must exist on the collision map. The starting location can be unwalkable.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">startX</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the x-coordinate for the starting location</li>
      <li><span class="parameter">startY</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the y-coordinate for the starting location</li>
      <li><span class="parameter">endX</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the x-coordinate for the goal location</li>
      <li><span class="parameter">endY</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the y-coordinate for the goal location</li>
      <li><span class="parameter">clearance</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the amount of clearance (i.e the pathing agent size) to consider</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">local path = myFinder:getPath(1,1,5,5)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">path</span></span>
        a path (array of nodes) when found, otherwise nil
    </ol>


</dd>
    <dt>
    <a name = "Pathfinder:reset"></a>
    <strong>Pathfinder:reset&nbsp;()</strong>
    </dt>
    <dd>
    Resets the <a href="../modules/pathfinder.html#">pathfinder</a> .  This function is called internally between successive pathfinding calls, so you should not
 use it explicitely, unless under specific circumstances.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local path, len = myFinder:getPath(1,1,5,5)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/pathfinder.html#">pathfinder</a></span>
        self (the calling <a href="../modules/pathfinder.html#">pathfinder</a>  itself, can be chained)
    </ol>


</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
